export interface MockConfig {
  enabled: boolean
  interval: number
  dataGenerator: (params: MockDataParams) => any
}

export interface MockDataParams {
  url: string
  index: number
  timestamp: number
}

export interface WebSocketOptions {
  url: string
  heartbeatMode?: 'active' | 'passive' // 心跳模式：主动发送ping或被动接收ping，默认active（主动）
  heartbeatInterval?: number // 心跳间隔，默认 30s
  heartbeatTimeout?: number // 心跳超时时间，默认 5s
  reconnectInterval?: number // 重连间隔，默认 5s
  reconnectTimes?: number // 最大重连次数，默认 5次
  bufferSize?: number // 缓冲池大小，默认 1000条
  bufferTimeout?: number // 缓冲池清空间隔，默认 1s
  clearBufferOnReconnect?: boolean // 是否在重连时清空缓冲池，默认 false
  mock?: MockConfig
  onStatusChange?: (connected: boolean) => void
  onError?: (error: Error) => void
}
